<?php

namespace app\api\validate;

use think\Validate;

class IndexValidate extends Validate
{
    protected $rule = [
        'nav_id' => 'require',
        'activity_id' => 'require',
        'name' => 'require',
        'mobile' => 'require',
        'content' => 'require',
        'email' => 'require',
    ];
    // 定义提示信息
    protected $message = [
        'nav_id.require' => '导航栏id不能为空',
        'activity_id.require' => '活动id不能为空',
        'name.require' => '姓名不能为空',
        'mobile.require' => '手机号不能为空',
        'content.require' => '内容不能为空',
        'email.require' => '邮箱不能为空',
    ];
    // 定义验证场景
    protected $scene = [
        'banner' => ['nav_id'],
        'register' => ['activity_id','name','mobile'],
        'contactUs' => ['email','name','mobile','content'],
    ];
}